package com.x.erp.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.statis.TVStatisDao;
import com.x.erp.model.Car;
import com.x.erp.model.statis.MarketStorageVO;
import com.x.erp.rpc.TVStatisRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Service(interfaceName = "com.x.erp.rpc.TVStatisRpcService", timeout = 60000)
public class TVStatisService extends BaseService implements TVStatisRpcService {

	@Autowired
	private TVStatisDao tvStatisDao;

	@Override
	public List<MarketStorageVO> searchMarketStorageInfo(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchMarketStorageInfo(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchCarOutStorageInfo(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarOutStorageInfo(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchDayCarStorageInfo(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchDayCarStorageInfo(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchDayCarOutStorageInfo(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchDayCarOutStorageInfo(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchDaySaleVolume(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchDaySaleVolume(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<Car> searchCarList(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarList(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<Car> searchCarSaleList(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarSaleList(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchStorageColorRank(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchStorageColorRank(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchCarOutStockColorRank(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarOutStockColorRank(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchCarOutStockPriceRank(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarOutStockPriceRank(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchCarOutStockRank(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarOutStockRank(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchCarSaleVolumeRank(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarSaleVolumeRank(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public int searchCarStock(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarStock(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchCarDisplacementRank(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarDisplacementRank(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public int searchCarFirstDetectInfo(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarFirstDetectInfo(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchDayCarFirstDetectInfo(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchDayCarFirstDetectInfo(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public int searchCarAuthNum(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarAuthNum(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchStockBrandRank(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchStockBrandRank(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public List<MarketStorageVO> searchCarOutAndInBrandContrast(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarOutAndInBrandContrast(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

	@Override
	public MarketStorageVO searchCarSaleVolume(MarketStorageVO marketStorageVO) {
		try {
			return tvStatisDao.searchCarSaleVolume(marketStorageVO);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}

}
